/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.listener;

import com.minierp.helper.EncCommonHelper;
import com.minierp.listener.FileUploadServer;
import java.net.ServerSocket;
import javax.servlet.ServletContext;

class FileUploadThread extends Thread {
	private ServletContext context;
	private ServerSocket server;
	private int port = 0;

	FileUploadThread(ServletContext ct, int pt) {
		this.context = ct;
		this.port = pt;
	}

	public void run() {
		try {
			this.server = new ServerSocket(this.port);
			EncCommonHelper.debug("************Port " + this.port
					+ " for file upload listening...");

			while (true) {
				FileUploadServer e = new FileUploadServer(this.server.accept(),
						this.context);
				e.start();
			}
		} catch (Exception arg1) {
			arg1.printStackTrace();
		}
	}

	public void socketClose() {
		try {
			this.server.close();
		} catch (Exception arg1) {
			;
		}

	}
}